#ifndef CLIENT_H_
#define CLIENT_H_

#include "../ipc/Message.h"
#include "../ipc/Queue.h"
#include "../common/CommonFunctions.h"
#include "../common/SIGINT_Handler.h"
#include "../common/SignalHandler.h"
#include "../common/Log.h"

#include <string.h>
#include <unistd.h>
#include <iostream>
#include <wait.h>
#include <iomanip>
#include <cstring>

using namespace std;

class Client
{
private:
	string nick;
	string chatName;
	Queue<message>* connection;
	int groupChatId;
	int pid;
	Log log;
	SIGINT_Handler sigint_handler;
	
	void connectToServer();
	void disconnectFromServer();
	void conversation();
	void sendMessages();
	void receiveMessages();
	void initMyGroupChat();
	void joinToGroupChat();
	void leftGroupChat();
	void showActiveGroupsChat();
	void showUsersGroupChat();
	void debug(string msg);

public:
	Client(string nick);
	void run();
	virtual ~Client();
};

#endif /*CLIENT_H_*/
